set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ")

add_definitions(-fPIC)
 
set (SRCS
    httpclient.cpp
    httpconnection.cpp
    httpconnector.cpp
    httpparser.cpp
    httprequest.cpp
    httpresponse.cpp
    httpserver.cpp
    httputil.cpp
    wsclient.cpp
    wsconnection.cpp
    wsutil.cpp
    http_parser.cpp
    )

add_definitions(-DHTTP_PARSER_STRICT=0)

include_directories(../)

##set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

if(NOT LIBRARY_INSTALL_PATH)
	set(LIBRARY_INSTALL_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL
		   "Single install directory for building all libraries.")
endif()

if(NOT INCLUDE_INSTALL_PATH)
	set(INCLUDE_INSTALL_PATH ${CMAKE_BINARY_DIR}/include CACHE INTERNAL
		   "Single install directory for building all includes.")
endif() 

add_library(toptnet_http ${SRCS})
target_link_libraries(toptnet_http toptnet)
install(TARGETS toptnet_http DESTINATION ${LIBRARY_INSTALL_PATH})

set (HEADERS
    httpclient.h
    httpconnection.h
    http_parser.h
    httpparser.h
    httprequest.h
    httpresponse.h
    httpserver.h
    httputil.h
    tnet_http.h
    wsclient.h
    wsconnection.h
    )

install(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_PATH}/tnet/http)
   
